package com.ny.service.impl;

import com.ny.entity.Classrooms;
import com.ny.mapper.ClassRoomMapper;
import com.ny.service.ClassroomService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class ClassroomServiceImpl implements ClassroomService {


    @Autowired
    private ClassRoomMapper classRoomMapper;

    //该接口定义了 `searchClassrooms` 方法，接收多个条件作为参数，用于多条件查询教室信息，返回 `List<Classrooms>` 类型的结果
    @Override
    public List<Classrooms> findAllClassrooms() {
        return classRoomMapper.findAllClassrooms();
    }


//该服务实现类实现了 `updateClassroomStatusById` 方法，
// 调用 `classroomMapper.updateClassroomStatusById(classroomId, status)` 进行教室状态的更新操作。 (管理员)
    @Override
    public void updateClassroomStatusById(int classroomId, String status) {
        classRoomMapper.updateClassroomStatusById(classroomId, status);
    }



    @Override
    public List<Classrooms> searchClassrooms(String classroomName, String capacity, String status, String building, String description) {
        return classRoomMapper.searchClassrooms(classroomName, capacity, status, building, description);
    }


}
